using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;

namespace ICP_MS.Plugin.Experiment;

public class FormInterfere : Form
{
	private IContainer components = null;

	private DataGridView dgvInterfere;

	private DataGridViewTextBoxColumn Column1;

	private DataGridViewTextBoxColumn Column2;

	private DataGridViewTextBoxColumn Column3;

	private DataGridViewTextBoxColumn Column4;

	private DataGridViewTextBoxColumn Column5;

	public FormInterfere(string data)
	{
		InitializeComponent();
		SetInterfereDatas(data);
	}

	private void SetInterfereDatas(string data)
	{
		List<string> ArrayString = data.Split(',').ToList();
		int i = 0;
		while (ArrayString.Count > 0)
		{
			dgvInterfere.Rows.Add();
			for (int j = 0; j < dgvInterfere.Columns.Count; j++)
			{
				if (ArrayString.Count <= 0)
				{
					break;
				}
				dgvInterfere.Rows[dgvInterfere.Rows.Count - 1].Cells[j].Value = ArrayString[0];
				ArrayString.RemoveAt(0);
			}
			i++;
		}
	}

	private void FormInterfere_Load(object sender, EventArgs e)
	{
		Text = Lang.Txt("AddFormInterfere.InterferingItems");
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
		this.dgvInterfere = new System.Windows.Forms.DataGridView();
		this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		((System.ComponentModel.ISupportInitialize)this.dgvInterfere).BeginInit();
		base.SuspendLayout();
		this.dgvInterfere.AllowUserToAddRows = false;
		this.dgvInterfere.AllowUserToDeleteRows = false;
		this.dgvInterfere.AllowUserToResizeColumns = false;
		this.dgvInterfere.AllowUserToResizeRows = false;
		this.dgvInterfere.BackgroundColor = System.Drawing.SystemColors.Control;
		this.dgvInterfere.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		this.dgvInterfere.ColumnHeadersVisible = false;
		this.dgvInterfere.Columns.AddRange(this.Column1, this.Column2, this.Column3, this.Column4, this.Column5);
		this.dgvInterfere.Dock = System.Windows.Forms.DockStyle.Fill;
		this.dgvInterfere.Location = new System.Drawing.Point(0, 0);
		this.dgvInterfere.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
		this.dgvInterfere.Name = "dgvInterfere";
		this.dgvInterfere.RowHeadersVisible = false;
		dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dgvInterfere.RowsDefaultCellStyle = dataGridViewCellStyle1;
		this.dgvInterfere.RowTemplate.Height = 40;
		this.dgvInterfere.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
		this.dgvInterfere.Size = new System.Drawing.Size(1001, 169);
		this.dgvInterfere.TabIndex = 2;
		this.Column1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.Column1.HeaderText = "Column1";
		this.Column1.Name = "Column1";
		this.Column1.ReadOnly = true;
		this.Column2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.Column2.HeaderText = "Column2";
		this.Column2.Name = "Column2";
		this.Column2.ReadOnly = true;
		this.Column3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.Column3.HeaderText = "Column3";
		this.Column3.Name = "Column3";
		this.Column3.ReadOnly = true;
		this.Column4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.Column4.HeaderText = "Column4";
		this.Column4.Name = "Column4";
		this.Column4.ReadOnly = true;
		this.Column5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.Column5.HeaderText = "Column5";
		this.Column5.Name = "Column5";
		this.Column5.ReadOnly = true;
		base.AutoScaleDimensions = new System.Drawing.SizeF(8f, 15f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(1001, 169);
		base.Controls.Add(this.dgvInterfere);
		base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
		base.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
		base.Name = "FormInterfere";
		base.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
		this.Text = "干扰项";
		base.Load += new System.EventHandler(FormInterfere_Load);
		((System.ComponentModel.ISupportInitialize)this.dgvInterfere).EndInit();
		base.ResumeLayout(false);
	}
}
